package com.ruoyi.system.service.yanglao.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.yanglao.YlRetirementOrganizeMapper;
import com.ruoyi.system.domain.yanglao.YlRetirementOrganize;
import com.ruoyi.system.service.yanglao.IYlRetirementOrganizeService;

/**
 * 养老机构Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-14
 */
@Service
public class YlRetirementOrganizeServiceImpl implements IYlRetirementOrganizeService 
{
    @Autowired
    private YlRetirementOrganizeMapper ylRetirementOrganizeMapper;

    /**
     * 查询养老机构
     * 
     * @param id 养老机构主键
     * @return 养老机构
     */
    @Override
    public YlRetirementOrganize selectYlRetirementOrganizeById(Long id)
    {
        return ylRetirementOrganizeMapper.selectYlRetirementOrganizeById(id);
    }

    /**
     * 查询养老机构列表
     * 
     * @param ylRetirementOrganize 养老机构
     * @return 养老机构
     */
    @Override
    public List<YlRetirementOrganize> selectYlRetirementOrganizeList(YlRetirementOrganize ylRetirementOrganize)
    {
        return ylRetirementOrganizeMapper.selectYlRetirementOrganizeList(ylRetirementOrganize);
    }

    /**
     * 新增养老机构
     * 
     * @param ylRetirementOrganize 养老机构
     * @return 结果
     */
    @Override
    public int insertYlRetirementOrganize(YlRetirementOrganize ylRetirementOrganize)
    {
        ylRetirementOrganize.setCreateTime(DateUtils.getNowDate());
        return ylRetirementOrganizeMapper.insertYlRetirementOrganize(ylRetirementOrganize);
    }

    /**
     * 修改养老机构
     * 
     * @param ylRetirementOrganize 养老机构
     * @return 结果
     */
    @Override
    public int updateYlRetirementOrganize(YlRetirementOrganize ylRetirementOrganize)
    {
        ylRetirementOrganize.setUpdateTime(DateUtils.getNowDate());
        return ylRetirementOrganizeMapper.updateYlRetirementOrganize(ylRetirementOrganize);
    }

    /**
     * 批量删除养老机构
     * 
     * @param ids 需要删除的养老机构主键
     * @return 结果
     */
    @Override
    public int deleteYlRetirementOrganizeByIds(Long[] ids)
    {
        return ylRetirementOrganizeMapper.deleteYlRetirementOrganizeByIds(ids);
    }

    /**
     * 删除养老机构信息
     * 
     * @param id 养老机构主键
     * @return 结果
     */
    @Override
    public int deleteYlRetirementOrganizeById(Long id)
    {
        return ylRetirementOrganizeMapper.deleteYlRetirementOrganizeById(id);
    }
}
